package com.example.myapplication.screen

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp

@Composable
fun LazyVeritcalGridDemo(innderPadding: PaddingValues){
    LazyVerticalGrid(
        modifier = Modifier.fillMaxSize()
            .padding(innderPadding),
        columns = GridCells.Fixed(5),   //每行多少个单元格
        horizontalArrangement = Arrangement.spacedBy(10.dp),
        verticalArrangement = Arrangement.spacedBy(10.dp)
    ) {
        items(50) {
            Text(
                text = it.toString(),
                modifier = Modifier.size(100.dp)
                    .background(color = Color.Cyan)
            )
        }
    }
}